﻿using DevComponents.DotNetBar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DotNetBarHans
{
    public static class DotNetBarHansHelper
    {
        public static void Han()
        {
            LocalizationKeys.LocalizeString -= LocalizationKeys_LocalizeString;
            LocalizationKeys.LocalizeString += LocalizationKeys_LocalizeString;
        }
        private static IReadOnlyDictionary<String, String> Hans { get; } = new Dictionary<string, string>
        {

              {LocalizationKeys.NavPaneCollapseButtonTooltip,"折叠导航窗格"},
              {LocalizationKeys.NavPaneExpandButtonTooltip,"展开导航窗格"},
              {LocalizationKeys.BarAutoHideButtonTooltip,"自动隐藏"},
              {LocalizationKeys.BarCustomizeButtonTooltip,"定制"},
              {LocalizationKeys.BarCloseButtonTooltip,"关闭"},
              {LocalizationKeys.BarMaximizeButtonTooltip,"barsys_maximize_tooltip"},
              {LocalizationKeys.CustomizeItemTooltip,"酒吧选项"},
              {LocalizationKeys.CustomizeItemAddRemove,"添加或删除按钮"},
              {LocalizationKeys.CustomizeItemCustomize,"定制..."},
              {LocalizationKeys.CustomizeItemReset,"重置栏"},
              {LocalizationKeys.OverlfowDisplayMoreTooltip,"更多按钮"},
              {LocalizationKeys.CustomizeDialogCaption,"定制"},
              {LocalizationKeys.CustomizeDialogTabToolbars,"工具栏"},
              {LocalizationKeys.CustomizeDialogTabCommands,"命令"},
              {LocalizationKeys.CustomizeDialogTabOptions,"选项"},
              {LocalizationKeys.CustomizeDialogKeyboardButton,"&键盘…"},
              {LocalizationKeys.CustomizeDialogCloseButton,"关闭"},
              {LocalizationKeys.CustomizeDialogNewToolbarButton,"&新的..."},
              {LocalizationKeys.CustomizeDialogRenameToolbarButton,"＆改名..."},
              {LocalizationKeys.CustomizeDialogDeleteToolbarButton,"删除"},
              {LocalizationKeys.CustomizeDialogResetToolbarButton,"＆重启..."},
              {LocalizationKeys.CustomizeDialogLabelDragInfo,"要将命令添加到条形图，请选择类别并将命令从该框拖出到条形图。"},
              {LocalizationKeys.CustomizeDialogLabelCategories,"类别(&G)："},
              {LocalizationKeys.CustomizeDialogLabelToolbars,"工具栏："},
              {LocalizationKeys.CustomizeDialogOptionsPersonalized,"个性化菜单和工具栏"},
              {LocalizationKeys.CustomizeDialogOptionsFullMenus,"始终显示完整菜单"},
              {LocalizationKeys.CustomizeDialogOptionsFullMenusDelay,"短暂延迟后显示完整菜单"},
              {LocalizationKeys.CustomizeDialogOptionsResetUsage,"重置我的使用数据 (&R)"},
              {LocalizationKeys.CustomizeDialogOptionsOther,"其他："},
              {LocalizationKeys.CustomizeDialogOptionsScreenTips,"在工具栏上显示屏幕和提示"},
              {LocalizationKeys.CustomizeDialogOptionsScreenTipsKeys,"在屏幕提示中显示快捷键 (&S)"},
              {LocalizationKeys.CustomizeDialogOptionsMenuAnimation,"菜单动画："},
              {LocalizationKeys.CustomizeDialogOptionsMenuAnimationNone,"（没有任何）"},
              {LocalizationKeys.CustomizeDialogOptionsMenuAnimationSys,"系统默认"},
              {LocalizationKeys.CustomizeDialogOptionsMenuAnimationRandom,"随机的"},
              {LocalizationKeys.CustomizeDialogOptionsMenuAnimationUnfold,"展开"},
              {LocalizationKeys.CustomizeDialogOptionsMenuAnimationSlide,"滑动"},
              {LocalizationKeys.CustomizeDialogOptionsConfirmDelete,"您确定要删除 <barname> 工具栏吗？"},
              {LocalizationKeys.CustomizeMenuReset,"重置"},
              {LocalizationKeys.CustomizeMenuDelete,"删除"},
              {LocalizationKeys.CustomizeMenuChangeName,"姓名："},
              {LocalizationKeys.CustomizeMenuDefaultStyle,"默认样式"},
              {LocalizationKeys.CustomizeMenuTextOnly,"纯文本（始终）"},
              {LocalizationKeys.CustomizeMenuImageAndText,"图像和文本（始终）"},
              {LocalizationKeys.CustomizeMenuBeginGroup,"开始组"},
              {LocalizationKeys.MdiSystemItemMinimizeTooltip,"最小化"},
              {LocalizationKeys.MdiSystemItemRestoreTooltip,"恢复"},
              {LocalizationKeys.MdiSystemItemCloseTooltip,"关闭"},
              {LocalizationKeys.MdiSystemItemMenuRestore,"恢复"},
              {LocalizationKeys.MdiSystemItemMenuMove,"移动"},
              {LocalizationKeys.MdiSystemItemMenuSize,"尺寸"},
              {LocalizationKeys.MdiSystemItemMenuMinimize,"最小化"},
              {LocalizationKeys.MdiSystemItemMenuMaximize,"最大化"},
              {LocalizationKeys.MdiSystemItemMenuClose,"关闭"},
              {LocalizationKeys.MdiSystemItemMenuNext,"下一个"},
              {LocalizationKeys.NavBarShowMoreButtons,"显示更多按钮(&M)"},
              {LocalizationKeys.NavBarShowFewerButtons,"显示更少的按钮(&F)"},
              {LocalizationKeys.NavBarOptions,"导航窗格选项 (&V)..."},
              {LocalizationKeys.NavBarDialogMoveUp,"navbar_navpanedialogmoveup"},
              {LocalizationKeys.NavBarDialogMoveDown,"navbar_navpanedialogmovedown"},
              {LocalizationKeys.NavBarDialogReset,"navbar_navpanedialogreset"},
              {LocalizationKeys.NavBarDialogOK,"navbar_navpanedialogok"},
              {LocalizationKeys.NavBarDialogCancel,"navbar_navpanedialogcancel"},
              {LocalizationKeys.NavBarDialogTitle,"navbar_navpanedialogtitle"},
              {LocalizationKeys.NavBarDialogListLabel,"navbar_navpanedialoglistlabel"},
              {LocalizationKeys.RenameBarDialogCaption,"重命名工具栏"},
              {LocalizationKeys.NewBarDialogCaption,"新工具栏"},
              {LocalizationKeys.BarEditDialogBarNameLabel,"工具栏名称(&T):"},
              {LocalizationKeys.BarEditDialogBarOkButton,"好的"},
              {LocalizationKeys.BarEditDialogBarCancelButton,"取消"},
              {LocalizationKeys.BarEditDialogInvalidNameMessage,"工具栏名称不能为空。"},
              {LocalizationKeys.ColorPickerThemeColorsLabel,"主题颜色"},
              {LocalizationKeys.ColorPickerStandardColorsLabel,"标准颜色"},
              {LocalizationKeys.ColorPickerMoreColorsMenuItem,"更多颜色 (&M)..."},
              {LocalizationKeys.ColorPickerDialogOKButton,"好的"},
              {LocalizationKeys.ColorPickerDialogCancelButton,"取消"},
              {LocalizationKeys.ColorPickerDialogNewColorLabel,"新的"},
              {LocalizationKeys.ColorPickerDialogCurrentColorLabel,"当前的"},
              {LocalizationKeys.ColorPickerDialogStandardColorsLabel,"颜色："},
              {LocalizationKeys.ColorPickerDialogCustomColorsLabel,"颜色："},
              {LocalizationKeys.ColorPickerDialogGreenLabel,"＆绿："},
              {LocalizationKeys.ColorPickerDialogBlueLabel,"＆蓝色："},
              {LocalizationKeys.ColorPickerDialogRedLabel,"＆红色的："},
              {LocalizationKeys.ColorPickerDialogColorModelLabel,"colorpickerdialog_colormodellabel"},
              {LocalizationKeys.ColorPickerDialogRgbLabel,"colorpickerdialog_rgblabel"},
              {LocalizationKeys.ColorPickerTabStandard,"标准"},
              {LocalizationKeys.ColorPickerTabCustom,"自定义"},
              {LocalizationKeys.ColorPickerCaption,"颜色"},
              {LocalizationKeys.QatCustomizeTooltip,"qat_customizetooltip"},
              {LocalizationKeys.MonthCalendarTodayButtonText,"今天"},
              {LocalizationKeys.MonthCalendarClearButtonText,"清除"},
              {LocalizationKeys.MessageBoxAbortButton,"关于"},
              {LocalizationKeys.MessageBoxCancelButton,"取消"},
              {LocalizationKeys.MessageBoxCloseButton,"关闭"},
              {LocalizationKeys.MessageBoxContinueButton,"继续"},
              {LocalizationKeys.MessageBoxHelpButton,"帮助"},
              {LocalizationKeys.MessageBoxIgnoreButton,"忽略"},
              {LocalizationKeys.MessageBoxNoButton,"否"},
              {LocalizationKeys.MessageBoxOkButton,"好"},
              {LocalizationKeys.MessageBoxRetryButton,"重试"},
              {LocalizationKeys.MessageBoxTryAgainButton,"重试"},
              {LocalizationKeys.MessageBoxYesButton,"是"},
              {LocalizationKeys.FormSystemMenuRestore,"FormSystemMenuRestore"},
              {LocalizationKeys.FormSystemMenuMove,"FormSystemMenuMove"},
              {LocalizationKeys.FormSystemMenuSize,"FormSystemMenuSize"},
              {LocalizationKeys.FormSystemMenuMinimize,"FormSystemMenuMinimize"},
              {LocalizationKeys.FormSystemMenuMaximize,"FormSystemMenuMaximize"},
              {LocalizationKeys.FormSystemMenuClose,"FormSystemMenuClose"},
              {LocalizationKeys.TimeSelectorOkButton,"好"},
              {LocalizationKeys.TimeSelectorClearButton,"清除"},
              {LocalizationKeys.TimeSelectorHourLabel,"时"},
              {LocalizationKeys.TimeSelectorMinuteLabel,"分"},
              {LocalizationKeys.SuperGridFilterShowAll,"SuperGrid_FilterShowAll"},
              {LocalizationKeys.SuperGridFilterShowNull,"SuperGrid_FilterShowNull"},
              {LocalizationKeys.SuperGridFilterShowNotNull,"SuperGrid_FilterShowNotnull"},
              {LocalizationKeys.SuperGridFilterCustom,"SuperGrid_FilterCustom"},
              {LocalizationKeys.SuperGridFilterEnterExpr,"SuperGrid_FilterEnterExpr"},
              {LocalizationKeys.SuperGridFilterSampleExpr,"SuperGrid_FilterSampleExpr"},
              {LocalizationKeys.SuperGridFilterCustomHelp,"SuperGrid_FilterCustomHelp"},
              {LocalizationKeys.SuperGridFilterApply,"SuperGrid_FilterApply"},
              {LocalizationKeys.SuperGridFilterOk,"SuperGrid_FilterOk"},
              {LocalizationKeys.SuperGridFilterCancel,"SuperGrid_FilterCancel"},
              {LocalizationKeys.SuperGridFilterClose,"SuperGrid_FilterClose"},
              {LocalizationKeys.SuperGridFilterClear,"SuperGrid_FilterClear"},
              {LocalizationKeys.SuperGridFilterReset,"SuperGrid_FilterReset"},
              {LocalizationKeys.SuperGridFilterByRelativeDate,"SuperGrid_FilterByRelativeDate"},
              {LocalizationKeys.SuperGridFilterBySpecificDate,"SuperGrid_FilterBySpecificDate"},
              {LocalizationKeys.SuperGridFilterByDateRange,"SuperGrid_FilterByDateRange"},
              {LocalizationKeys.SuperGridFilterCurrentMonth,"SuperGrid_FilterCurrentMonth"},
              {LocalizationKeys.SuperGridFilterCurrentYear,"SuperGrid_FilterCurrentYear"},
              {LocalizationKeys.SuperGridFilterLastMonthPeriod,"SuperGrid_FilterLastMonthPeriod"},
              {LocalizationKeys.SuperGridFilterLast3MonthPeriod,"SuperGrid_FilterLast3MonthPeriod"},
              {LocalizationKeys.SuperGridFilterLast6MonthPeriod,"SuperGrid_FilterLast6MonthPeriod"},
              {LocalizationKeys.SuperGridFilterLast9MonthPeriod,"SuperGridFilter_Last9MonthPeriod"},
              {LocalizationKeys.SuperGridFilterLastYear,"SuperGrid_FilterLastYear"},
              {LocalizationKeys.SuperGridFilterLast5YearPeriod,"SuperGrid_FilterLast5YearPeriod"},
              {LocalizationKeys.SuperGridFilterLast10YearPeriod,"SuperGrid_FilterLast10YearPeriod"},
              {LocalizationKeys.SuperGridFilterExprError,"SuperGrid_FilterExprError"},
              {LocalizationKeys.SuperGridFilterMissingParen,"SuperGrid_FilterMissingParen"},
              {LocalizationKeys.SuperGridFilterMissingQuote,"SuperGrid_FilterMissingQuote"},
              {LocalizationKeys.SuperGridFilterInvalidArgCount,"SuperGrid_FilterInvalidArgCount"},
              {LocalizationKeys.SuperGridFilterInvalidArg,"SuperGrid_FilterInvalidArg"},
              {LocalizationKeys.SuperGridFilterInvalidEmptyOp,"SuperGrid_FilterInvalidEmptyOp"},
              {LocalizationKeys.SuperGridFilterInvalidDateTimeOp,"SuperGrid_FilterInvalidDateTimeOp"},
              {LocalizationKeys.SuperGridFilterInvalidBoolOp,"SuperGrid_FilterInvalidBoolOp"},
              {LocalizationKeys.SuperGridFilterInvalidStringOp,"SuperGrid_FilterInvalidStringOp"},
              {LocalizationKeys.SuperGridFilterInvalidNumericOp,"SuperGrid_FilterInvalidNumericOp"},
              {LocalizationKeys.SuperGridFilterInvalidEval,"SuperGrid_FilterInvalidEval"},
              {LocalizationKeys.SuperGridFilterUndefinedFunction,"SuperGrid_FilterUndefinedFunction"},
              {LocalizationKeys.SuperGridFilterCustomFilter,"SuperGrid_FilterCustomFilter"},
              {LocalizationKeys.SuperGridNewFilterExpr,"SuperGrid_NewFilterExpr"},
              {LocalizationKeys.SuperGridNewFilter,"SuperGrid_NewFilter"},
              {LocalizationKeys.SuperGridDeleteFilter,"SuperGrid_DeleteFilter"},
              {LocalizationKeys.SuperGridFilterName,"SuperGrid_FilterName"},
              {LocalizationKeys.SuperGridFilterDescription,"SuperGrid_FilterDescription"},
              {LocalizationKeys.SuperGridShowInFilterPopup,"SuperGrid_ShowInFilterPopup"},
              {LocalizationKeys.SuperGridFilterHelpTitle,"SuperGrid_FilterHelpTitle"},
              {LocalizationKeys.SuperGridGroupByWaterMarkText,"SuperGrid_GroupByWaterMarkText"},
        };
        private static void LocalizationKeys_LocalizeString(object sender, LocalizeEventArgs e)
        {
            if (Hans.TryGetValue(e.Key, out var value) && value != e.Key)
            {
                e.LocalizedValue = value;
                e.Handled = true;
            }
        }
    }
}
